from flask_apscheduler.auth import HTTPBasicAuth
from apscheduler.jobstores.sqlalchemy import SQLAlchemyJobStore


class BaseConfig:
    # session的盐
    SECRET_KEY = "0f4323ad28a271fb5dbf8fc40246cfda"
    SQLALCHEMY_TRACK_MODIFICATIONS = False
    DEBUG = True


class DevelopmentConfig(BaseConfig):
    # 数据库配置信息
    # MySQL所在的主机名
    HOSTNAME = "localhost"
    # MySQL监听的端口号，默认3306
    PORT = 3306
    # 连接MySQL的用户名，读者用自己设置的
    USERNAME = "root"
    # 连接MySQL的密码，读者用自己的
    PASSWORD = "123456"
    # MySQL上创建的数据库名称
    DATABASE = "violence_monitoring"
    DB_URI = f"mysql+pymysql://{USERNAME}:{PASSWORD}@{HOSTNAME}:{PORT}/{DATABASE}?charset=utf8mb4"
    # 增加连接池大小和最大溢出连接数的设置
    SQLALCHEMY_DATABASE_URI = DB_URI
    SQLALCHEMY_POOL_SIZE = 20  # 连接池大小
    SQLALCHEMY_MAX_OVERFLOW = 10  # 最大溢出连接数

